<?php
$toolbar    =new ToolBarHelper($act);
$toolbar->setSubmitAjax(true);
if($act=="add" || $act=="addcontent")
{
    if($act=="add")
    {
        $title = '[New Category]';
    }else if($act=="addcontent")
    {
        $title = '[New Content]';
    }

    $toolbar->SetTitle($title);
    $toolbar->Back(getUrlBack());
    $toolbar->Save('Save',2);
    $toolbar->Save('Save & Exit');
}
else if($act=="edit" || $act=="editcontent")
{
    if($module!="module" && $act=="edit")
    {
        $title = '[Edit Category]';
    }else if($act=="editcontent")
    {
        $title = '[Edit Content]';
    }
    $toolbar->SetTitle($title);
    $toolbar->Back(getUrlBack());
    $toolbar->Apply();
    $toolbar->Save();
}
else if($act=="background")
{
    $toolbar->SetTitle("[".getLang('Medal')."]");
    $toolbar->Back(getUrlBack());
    $toolbar->Apply();
    $toolbar->Save();
}
else if($module=="module")
{
    $toolbar->setSubmitAjax(false);
    $toolbar->Apply();
    $toolbar->addNew('add','New Module','id='.$id);
}
else
{
    $toolbar->setSubmitAjax(false);
    if(count($contents)>0)
    {
        $toolbar->Delete('delcontent');
    }else if(count($categories)>0)
    {
        $toolbar->Delete();
    }else
    {
        $toolbar->Delete('delete','Delete Category','id='.$id);
    }

    $toolbar->Apply();
    $toolbar->Edit('edit','Edit Category','id='.$id);
    $toolbar->addNew('add','New Category','id='.$id);
    if(!isModule($id) && $module!='typicalworks')
    {
        $toolbar->addNew('addcontent','New Content','id='.$id);
    }
    if($module=="home")
    {
        $toolbar->background('background',getLang('Medal'),'id='.$id);
    }
}
?>